
<!-- 
 * App页面
 * @author: 
 * @since: 2022-04-01
 * App.vue
-->
<template>
  <router-view v-if="isRouterActive"></router-view>
</template>

<script setup>
import { onMounted, computed, provide, ref, nextTick } from 'vue';
import { useStore } from 'vuex';
import { useRouter } from "vue-router";
import { sessionstorage } from "@/utils/storage";
const router = useRouter();


const store = useStore();

const isRouterActive = ref(true)


onMounted(() => {
  // changeBodyWidth();
  // window.addEventListener('resize', changeResize);
  window.addEventListener("unload", () => {
    sessionstorage.set('token', token)
  });
});

provide('reload', () => {
  isRouterActive.value = false
  nextTick(() => {
    isRouterActive.value = true
  })
})



// const changeBodyWidth = () => {
//   const flag = document.body.getBoundingClientRect().width - 1 < 992
//   store.dispatch('setting/changeMobile', flag);
// };

// const changeResize = () => {
//   changeBodyWidth();
// };
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif, 'Microsoft YaHei';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
}
</style>
